public class test {
    private static double discount=0.98;
    private static int totalNum=0;
    private static int n=0;
    private static double sum=0;



    public static void main(String[] args) {
        seller seller1 = new seller(5, 23.5);
        seller seller2 = new seller(12, 24.56);
        seller seller3 = new seller(100, 21.5);

        n=seller1.getQuantity()+seller2.getQuantity()+seller3.getQuantity();
        sum=seller1.getTotalPrice()+seller2.getTotalPrice()+seller3.getTotalPrice();
        double average = average();
        display(average);

    }
    public static double average(){
        double average = sum/n;
        return average;

    }
    public static void display(double average){
        System.out.println("销售额是:"+sum);
        System.out.println("每件商品的平均售价:"+average);

    }

}

class seller{
    public int quantity;
    public double price;
    public double totalPrice;

    public int getQuantity() {
        return quantity;
    }

    public double getTotalPrice() {
        return totalPrice;
    }

    public seller(int quantity, double price) {
        this.quantity = quantity;
        this.price = price;
        this.totalPrice= quantity*price;
    }
}